package cn.iocoder.yudao.module.ad.dal.mysql.legaladviceclueqa;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.ad.dal.dataobject.legaladviceclueqa.AdLegalAdviceClueQaDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.ad.controller.admin.legaladviceclueqa.vo.*;

/**
 * 法律咨询线索对话 Mapper
 *
 * @author 数创万维
 */
@Mapper
public interface AdLegalAdviceClueQaMapper extends BaseMapperX<AdLegalAdviceClueQaDO> {

    default PageResult<AdLegalAdviceClueQaDO> selectPage(AdLegalAdviceClueQaPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<AdLegalAdviceClueQaDO>()
                .eqIfPresent(AdLegalAdviceClueQaDO::getUserId, reqVO.getUserId())
                .eqIfPresent(AdLegalAdviceClueQaDO::getContactUserMobile, reqVO.getContactUserMobile())
                .likeIfPresent(AdLegalAdviceClueQaDO::getContactUserRealname, reqVO.getContactUserRealname())
                .eqIfPresent(AdLegalAdviceClueQaDO::getAreaCode, reqVO.getAreaCode())
                .eqIfPresent(AdLegalAdviceClueQaDO::getQaType, reqVO.getQaType())
                .eqIfPresent(AdLegalAdviceClueQaDO::getQaDetailType, reqVO.getQaDetailType())
                .eqIfPresent(AdLegalAdviceClueQaDO::getQaMode, reqVO.getQaMode())
                .eqIfPresent(AdLegalAdviceClueQaDO::getQaBgContentOmit, reqVO.getQaBgContentOmit())
                .likeIfPresent(AdLegalAdviceClueQaDO::getNickName, reqVO.getNickName())
                .eqIfPresent(AdLegalAdviceClueQaDO::getMobile, reqVO.getMobile())
                .eqIfPresent(AdLegalAdviceClueQaDO::getQaTypeTitle, reqVO.getQaTypeTitle())
                .eqIfPresent(AdLegalAdviceClueQaDO::getQaDetailTypeTitle, reqVO.getQaDetailTypeTitle())
                .likeIfPresent(AdLegalAdviceClueQaDO::getProvinceName, reqVO.getProvinceName())
                .likeIfPresent(AdLegalAdviceClueQaDO::getAreaName, reqVO.getAreaName())
                .eqIfPresent(AdLegalAdviceClueQaDO::getQaContent, reqVO.getQaContent())
                .betweenIfPresent(AdLegalAdviceClueQaDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(AdLegalAdviceClueQaDO::getAdClueId, reqVO.getAdClueId())
                .orderByDesc(AdLegalAdviceClueQaDO::getId));
    }

}